<include file="Public/common" />
<block name="css">
    <style>

        input class="form-control"::-webkit-outer-spin-button,
        input class="form-control"::-webkit-inner-spin-button{
            -webkit-appearance: none !important;
            margin: 0;
        }
        .bloder{
            font-weight: bold;
            text-align: right;
        }
        .col-xs-12{
            margin-bottom: 10px;
        }
        .col-xs-12:after{
            content: '';
            display: table;
            height: 0;
            clear: both;
        }
    </style>
</block>
<block name="content">
    <div class="page-header"><h1>首页 > 财务管理 &gt;自营产品收入报表</h1></div>

    <div class="tab-content clearfix">
        <div class="row" >
            <form action="" id="settlement-form" class="form-inline"  style="margin-left:10px;" >
                <div class="col-xs-12">
                    <div class="col-xs-4">
                        <label for="" class="col-xs-4 bloder">团号：</label>
                        <div class="col-xs-8"><input class="form-control" type="text" name="group_num" value="<if condition="$_GET['group_num']">{$_GET['group_num']}</if>" /></div>
                    </div>
                    <div class="col-xs-4">
                        <label for="" class="col-xs-4 bloder">线路名称：</label>
                        <div class="col-xs-8"><input class="form-control" type="text" name="line_name" value="<if condition="$_GET['line_name']">{$_GET['line_name']}</if>" /></div>
                    </div>
                    <div class="col-xs-4">
                        <label for="" class="col-xs-4 bloder">发票号：</label>
                        <div class="col-xs-8"><input class="form-control" type="text" name="receipt_num" value="<if condition="$_GET['receipt_num']">{$_GET['receipt_num']}</if>" /></div>
                    </div>
                </div>
                <div class="col-xs-12">
                    <div class="col-xs-4">
                        <label for="" class="col-xs-4 bloder">门店名称：</label>
                        <div class="col-xs-8">
                            <select name="shop_id">
                                <option value="">请选择</option>
                                <foreach name="shop" item="v">
                                    <option <if condition="$_GET['shop_id'] == $v['operator_id']">{$_GET['shop_id']}</if>value="{$v['operator_id']}">{$v['store_name']}</option>
                                </foreach>
                            </select>
                        </div>
                    </div>

                    <div class="col-xs-4">
                        <label for="" class="col-xs-4 bloder">销售人员：</label>
                        <div class="col-xs-8">
                            <input class="form-control" type="text" name="sales" value="<if condition="$_GET['sales']">{$_GET['sales']}</if>" />
                        </div>
                    </div>

                    <div class="col-xs-4">
                        <label for="" class="col-xs-4 bloder">收款人：</label>
                        <div class="col-xs-8">
                            <input class="form-control" type="text" name="payee" value="<if condition="$_GET['payee']">{$_GET['payee']}</if>" />
                        </div>
                    </div>
                </div>
                <div class="col-xs-12">
                        <label for="" class="col-xs-1 bloder">下单时间：</label>
                        <div class="col-xs-2">
                            <input class="form-control" type="text" id="start" name="strat" value="<if condition="$_GET['start']">{$_GET['start']}</if>" />
                        </div>
                        <div class="col-xs-2">
                            <input class="form-control" type="text" id="end" name="end" value="<if condition="$_GET['end']">{$_GET['end']}</if>" />
                        </div>
                    </div>
                </div>
                <div class="col-xs-10"  style="margin-bottom: 0;">
                    <a href="{:U('outSelfIncome')}" class="btn btn-primary">导出</a>
                    <button type="submit" class="btn btn-primary submit-btn">查询</button>
                </div>
                <div class="col-xs-2 text-danger bolder"  style="margin-bottom: 0;">
                    总营业收入：{$all_total_money}
                </div>
            </form>
        </div>
        <table id="table" class="table table-striped table-bordered table-hover table-condensed mt-15">
            <thead>
                <tr>
                    <th >订单信息</th>
                    <th>门店</th>
                    <th>销售人员</th>
                    <th>人数</th>
                    <th>订单总额</th>
                    <th>实收金额</th>
                    <th>优惠金额</th>
                    <th>收款人</th>
                    <th>发票号</th>
                </tr>
            </thead>
            <tbody>
                <volist name="list" id="v" key="i">
                    <tr>
                        <td>
                            订单号：{$v.order_num}<br>
                            团号：{$v.group_num}<br>
                            线路名称：{$v.line_name}<br>
                        </td>
                        <td>{$v['store_name']}</td>
                        <td>{$v['operator_name']}</td>
                        <td>{$v['total_num']}</td>
                        <td>{$v['total_money']}</td>
                        <td>{$v['end_need_pay']}</td>
                        <td>{$v['preferential']}</td>
                        <td>{$v['payee'] | default='无'}</td>
                        <td>{$v['receipt_num']}</td>
                    </tr>
                </volist>

            </tbody>
        </table>
    </div>
    <div class="modal fade" id="bjy-edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> &times;</button>
                    <h4 class="modal-title" id="myModalLabel"> 外币结算</h4></div>
                <div class="modal-body">
                    <form id="bjy-form" class="form-inline" action="{:U('Finance/singleForeignSettlement')}" method="post">
                        <input class="form-control" type="hidden" name="order_id" id="order_id">
                        <table class="table table-striped table-bordered table-hover table-condensed">
                            <tr>
                                <th width="17%">结算金额：</th>
                                <td><span class="total_money"></span></td>
                            </tr>
                            <tr>
                                <th>汇率：</th>
                                <td><input class="form-control" class="input class="form-control"-medium" type="text" id="settlement_rate" name="settlement_rate" placeholder="请输入汇率"></td>
                            </tr>
                            <tr>
                                <th>实收金额：</th>
                                <td><input class="form-control" class="input class="form-control"-medium" type="text" id="end_foreign_money" name="end_foreign_money" value="0" placeholder="请输入实际收取的金额"><span class="currency_type"></span></td>
                            </tr>
                            <tr>
                                <th>实收人民币：</th>
                                <td><input class="form-control" class="input class="form-control"-medium" readonly type="text" name="end_need_pay"></td>
                            </tr>
                            <tr>
                                <th></th>
                                <td><input class="form-control" class="btn btn-success" type="submit" value="修改"></td>
                            </tr>
                        </table>
                    </form>
                </div>
            </div>
        </div>
    </div>
 <ul class="pagination">{$show}</ul>
</block>
<block name="js">
<script src="__JS__/jedate/jedate.js"></script>
<script>
    /**
     * 绑定日期选择器
     * @param  {[obj]}    obj        [元素]
     * @param  {[string]} dateFormat [时间格式]
     */
    function dateFormat(obj, dateFormat){
        jeDate({
            dateCell: '#'+$(obj).attr('id'),
            format: dateFormat,
            isinitVal:false,
            isTime:true, //isClear:false,
            okfun:function(val){
            }
        });
    }
   dateFormat($('#start'), 'YYYY-MM-DD');
   dateFormat($('#end'), 'YYYY-MM-DD');
</script>
</block>
